#include<stdio.h>


void print1(int x)
{
    if(x%2==0&&(x>4&&x<=12))
    {
        printf("1 ");
    }
    else
    {
        printf("0 ");
    }
}


void print2(int x)
{
    if(x%2==0||(x>4&&x<=12))
    {
        printf("1 ");
    }
    else{
        printf("0 ");
    }
}

void print3(int x)
{
    if(x%2==0&&!(x>4&&x<=12))
    {
        printf("1 ");
    }
    else if(!(x%2==0)&&(x>4&&x<=12))
    {
        printf("1 ");
    }
    else
    {
        printf("0 ");
    }
}



void print4(int x)
{
    if(!(x%2==0)&&!(x>4&&x<=12))
    {
        printf("1 ");
    }
    else
    {
        printf("0 ");
    }
}



int main()
{
    int x;
    scanf("%d",&x);
    print1(x);
    print2(x);
    print3(x);
    print4(x);
    return 0;
}